import React from "react";

const Sequence = (props) => {
    
    const handleClick = () => {
        // 调用API，往编辑器中插入一个数字
        props.editor.insertText(
            "```mermaid\n" + 
            "sequenceDiagram\n" + 
            "A->>B: 你好吗?\n" + 
            "B->>A: 我很好!\n" + 
            "```\n\n" + 
            "<p>请参考<a href=\"https://github.com/mermaid-js/mermaid\" target=\"_blank\">mermaid</a>。</p>"
        );
    }

    return (
        <span
        className="button button-type-counter"
        title="系列图"
        onClick={handleClick}
        >
        <i className="fa fa-exchange" />
        </span>
    );
}

Sequence.align = 'left';
Sequence.pluginName = 'sequence';

export default Sequence;